from django.db import models
from django.contrib.auth.models import AbstractUser


class User(AbstractUser):
    # unique=True同一个值在一个表只能出现一次
    mobile = models.CharField(verbose_name='手机号码', max_length=11, unique=True)
    avatar = models.ImageField(upload_to='avatar', verbose_name='用户头像', null=True, blank=True,
                               help_text="头像大小规格为256x256或对应规格")

    class Meta:
        db_table = 'ly_users'
        verbose_name = '用户'
        verbose_name_plural = verbose_name
